package org.hawk.gwt.ppc.scanner.utils;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;


/**
 * Represents basic statement of java language.
 *  
 * @author alex.bereznevatiy@gmail.com
 */
abstract class JavaStatement {
	
	private List<JavaModifier> modifiers;
	
	protected JavaStatement() {
	}

	/**
	 * @return list of modifiers of this java statement.
	 * @see JavaModifier
	 */
	public List<JavaModifier> getModifiers() {
		return Collections.unmodifiableList(modifiers);
	}
	
	void setModifiers(List<JavaModifier> modifiers) {
		if (this.modifiers == null) {
			this.modifiers = new ArrayList<JavaModifier>();
		} else {
			this.modifiers.clear();
		}
		if (modifiers != null) {
			this.modifiers.addAll(modifiers);
		}
	}
}
